package com.swust.book_shop.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

import javax.validation.constraints.Size;

/**
 * 
 * @TableName user_info
 */
@TableName(value ="user_info")
@Data
public class UserInfo implements Serializable {
    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 账户
     */
    @Size(min=0,max = 10,message = "账号长度不在0-10之间")
    @TableField(value = "account")
    private String account;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 性别
     */
    @TableField(value = "gender")
    private String gender;

    /**
     * 学院
     */
    @TableField(value = "coollege")
    private String coollege;

    /**
     * 班级
     */
    @TableField(value = "grade")
    private String grade;

    /**
     * 该用户是否注销(默认没有)
     */
    @TableField(value = "is_deleted")
    @TableLogic
    private String isDeleted;

    /**
     * 是否可上传书本(默认不能)
     */
    @TableField(value = "is_up_book")
    private String isUpBook;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime update_time;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime create_time;

    /**
     * 电话
     */
    @TableField(value = "phone_number")
    private String phoneNumber;

    /**
     * 用户头像
     */
    @TableField(value = "image")
    private String image;

    /**
     * 身份证号
     */
    @TableField(value = "id_number")
    private String idNumber;

    /**
     * 用户名字
     */
    @TableField(value = "username")
    private String username;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}